<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>${sysName}</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${resRoot}/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all" />
	<link rel="stylesheet" href="${resRoot}/layui/admin/admin.css" media="all" />
	<link id="layuicss-layer" rel="stylesheet" href="${resRoot}/layui/css/modules/layer/default/layer.css" media="all">
</head>
<body class="childrenBody">
	<div class="layui-fluid">   
          <div class="layui-card">

	<div class="layui-form layui-card-header layuiadmin-card-header-auto">
		<div class="layui-card layuiAdmin-msg-detail">
		<@shiro.hasPermission name="article:show">
		<div class="layui-card-header"> 
		<h1><b>所属类型：</b>${ArticleDTO.typeName!} &nbsp;&nbsp;&nbsp;&nbsp; <b>昵称：</b> ${ArticleDTO.nickName}</h1> 
		<p> <span><b>发布时间</b>:${ArticleDTO.createTime?datetime}</span>      <span><b>阅读数量</b>:${ArticleDTO.readCount}</span> </p> 
		</div>
      <div class="site-demo-upload" id="site-demo-upload">
      <#if ArticleDTO?? && ArticleDTO.picUrlList?? >
      <#list ArticleDTO.picUrlList as picUrl>
  <img id="LAY_demo_upload" src="${picUrl}" onclick="removeThis();" style="max-width:200px;max-height:200px;margin-left: 5px;">
      </#list>
  </#if>
</div>
		<div class="layui-card-body layui-text">
			<div class="layadmin-text">
			${ArticleDTO.content}
			</div>
		</div>
		</@shiro.hasPermission>
		</div>
		
		<div class="layui-form-item">
    <div class="layui-input-block">
    
    <@shiro.hasPermission name="article:audit">
						<#if ArticleDTO.audit?? && ArticleDTO.audit=="0">
						<button type="button" class="layui-btn" onclick="audit(${ArticleDTO.id});" >审核</button>
						</#if>
					</@shiro.hasPermission>
    
      <button type="button" class="layui-btn layui-btn-primary" onclick="history.go(-1);" >返回</button>
    </div>
  </div>
	</div>
	
	<script type="text/javascript" src="${resRoot}/layui/layui.js"></script>
	<script src="${resRoot}/js/jquery.min.js?v=2.1.4"></script>
	<script src="${resRoot}/layui/layui.all.js" charset="utf-8"></script>
	<script type="text/javascript">
	layui.use(['form', 'layedit', 'laydate'], function(){
		  var form = layui.form
		  ,layer = layui.layer
		  ,layedit = layui.layedit
		  ,laydate = layui.laydate;
	parent.layer.photos({
		  photos: '#site-demo-upload'
			  // , area: ['500px','300px']
		  ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
		}); 
	}); 
	
	function audit(id) {
			layer.confirm('确定审核该条数据吗？', {
			  btn: ['通过','驳回'] //按钮
			}, function(){
				$.ajax({
				type : "post",
				url : "${base}/sys/article/audit",
				data : {
					id : id
					},
				dataType : "json",
				async : false,
				success : function(data) {
					 if(data.message == 1) {
							layer.msg('审核成功！', {
							  icon: 1,
							  time: 2000 //2秒关闭（如果不配置，默认是3秒）
							}, function(){
								window.location.reload();
							});   
						} else {
							layer.msg('系统繁忙！'); 
						}
				}
			}); 
			}, function(){
				$.ajax({
				type : "post",
				url : "${base}/sys/article/reject",
				data : {
					id : id
					},
				dataType : "json",
				async : false,
				success : function(data) {
					 if(data.message == 1) {
							layer.msg('驳回成功！', {
							  icon: 1,
							  time: 2000 //2秒关闭（如果不配置，默认是3秒）
							}, function(){
								window.location.reload();
							});   
						} else {
							layer.msg('系统繁忙！'); 
						}
				}
			}); 
			});
			
			
		}
	</script>
</body>
</html>

